export default function ({ percent = 80, name = '中原复合肥市场占有率' } = {}) {
  return {
    title: [
      {
        text: `${percent}%`,
        x: 'center',
        y: 'center',
        textStyle: {
          color: '#fff',
          fontSize: 20,
        },
      },
      {
        text: name,
        x: 'center',
        y: '90%',
        textStyle: {
          color: '#fff',
          fontSize: 14,
        },
      },
    ],
    tooltip: {
      trigger: 'item',
      formatter: data => {
        const { marker, value, name: seriesName } = data;
        if (!seriesName) return false;
        return `${marker}${name}: ${value}%`;
      },
    },
    series: [
      {
        name: '',
        type: 'pie',
        clockWise: true,
        radius: ['65%', '70%'],
        itemStyle: {
          normal: {
            label: {
              show: false,
            },
            labelLine: {
              show: false,
            },
          },
        },
        hoverAnimation: false,
        data: [
          {
            value: 80,
            name: '进度',
            itemStyle: {
              color: '#39C6FC',
              label: {
                show: false,
              },
              labelLine: {
                show: false,
              },
            },
          },
          {
            name: '',
            value: 100 - percent,
            itemStyle: {
              color: '#3B504F',
            },
          },
        ],
      },
    ],
  };
}
